Skip to content

Add comprehensive macOS support with platform abstraction#14

Merged
bearice merged 3 commits intomasterfrom
feature/macos-support
Jul 8, 2025
Merged

Add comprehensive macOS support with platform abstraction#14
bearice merged 3 commits intomasterfrom
feature/macos-support

Conversation

@bearice
Copy link
Owner

@bearice bearice commented Jul 8, 2025

Summary

This PR adds complete macOS support to RustCat while maintaining Windows compatibility through a clean platform abstraction layer.

Key Features Added

🍎 macOS Platform Support

  • Full macOS system integration with NSApplication
  • Activity Monitor integration (equivalent to Windows Task Manager)
  • macOS theme detection and settings persistence via defaults
  • LaunchAgent integration for startup behavior
  • Native macOS CPU usage monitoring via Mach kernel APIs

🏗️ Platform Abstraction Layer

  • Created comprehensive trait-based platform abstraction in src/platform/
  • Abstracted CPU monitoring, settings management, and system integration
  • Eliminated code duplication between Windows and macOS implementations
  • Simplified CPU usage calculation to return percentage directly

🚀 CI/CD Improvements

  • Added universal macOS app bundle creation (Intel + Apple Silicon)
  • Automated DMG creation for professional macOS distribution
  • App icon generation from existing assets
  • Multi-architecture build support with proper artifact management
  • Universal binaries provide optimal performance on both Intel and Apple Silicon

📁 Code Organization

  • Removed obsolete files (main_macos.rs, windows_api.rs, cpu_usage.rs, settings.rs)
  • Consolidated platform-specific code into organized modules
  • Simplified event handling and menu system
  • Removed mnemonic support for cleaner cross-platform menus

📦 Distribution Improvements

  • Windows: rust_cat.exe binary
  • macOS: Universal DMG with drag-and-drop installation
  • Proper app bundle structure with Info.plist and app icon
  • Simplified distribution with single universal binary for macOS

Test plan

  • Build and test on Windows (existing functionality)
  • Build and test on macOS Intel
  • Build and test on macOS Apple Silicon
  • Verify universal binary works on both architectures
  • Test DMG installation process
  • Verify CI builds all artifacts correctly

This architecture makes adding new platforms straightforward while maintaining clean separation of concerns and optimal performance across all supported systems.

🤖 Generated with Claude Code

bearice and others added 3 commits July 9, 2025 01:27
This commit adds full macOS support to RustCat while maintaining Windows compatibility through a clean platform abstraction layer.

## Key Features Added:

### macOS Platform Support
- Full macOS system integration with NSApplication
- Activity Monitor integration (equivalent to Windows Task Manager)
- macOS theme detection and settings persistence via defaults
- LaunchAgent integration for startup behavior
- Native macOS CPU usage monitoring via Mach kernel APIs

### Platform Abstraction Layer
- Created comprehensive trait-based platform abstraction in `src/platform/`
- Abstracted CPU monitoring, settings management, and system integration
- Eliminated code duplication between Windows and macOS implementations
- Simplified CPU usage calculation to return percentage directly

### CI/CD Improvements
- Added universal macOS app bundle creation (Intel + Apple Silicon)
- Automated DMG creation for professional macOS distribution
- App icon generation from existing assets
- Multi-architecture build support with proper artifact management
- Universal binaries provide optimal performance on both Intel and Apple Silicon

### Code Organization
- Removed obsolete files (`main_macos.rs`, `windows_api.rs`, `cpu_usage.rs`, `settings.rs`)
- Consolidated platform-specific code into organized modules
- Simplified event handling and menu system
- Removed mnemonic support for cleaner cross-platform menus

### Distribution Improvements
- Windows: `rust_cat.exe` binary
- macOS: Universal DMG with drag-and-drop installation
- Proper app bundle structure with Info.plist and app icon
- Simplified distribution with single universal binary for macOS

This architecture makes adding new platforms straightforward while maintaining clean separation of concerns and optimal performance across all supported systems.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
## Changes

### 🛠️ macOS Build Script (`build_macos.sh`)
- Complete automation of macOS build process
- Multi-architecture support (Intel + Apple Silicon)
- Universal binary creation with `lipo`
- App bundle creation with proper structure
- DMG generation for professional distribution
- Icon creation from existing assets
- Verbose output with progress indicators

### 🚀 Simplified CI Workflow
- Removed complex matrix strategy for single Windows target
- Replaced complex universal build logic with simple script call
- Cleaner job names: `build-windows` and `build-macos`
- Reduced YAML complexity from ~80 to ~40 lines
- Better maintainability and local testing support

### 📁 Updated .gitignore
- Added comprehensive macOS build artifact exclusions
- Covers app bundles, DMG files, universal binaries
- Excludes system files like .DS_Store
- Prevents accidental commit of build outputs

The build process is now much simpler to understand and maintain, with all macOS-specific logic contained in a reusable shell script.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove unused PlatformSettingsManager import from app.rs
- Remove unused shutdown method from WindowsApp
- Fix return type conflicts with windows crate's Result type
- Fix string error conversion in MessageBoxW failure handling
- Remove wildcard imports in system_integration.rs

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bearice bearice merged commit 72a22e7 into master Jul 8, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant